package com.zhida.jiyangcenter.api

import chooongg.base.manager.app
import chooongg.http.HttpManager
import com.vehicle.inspection.api.BaseTokenInterceptor
import com.zhida.jiyangcenter.DEFAULT_ROW
import okhttp3.RequestBody
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.*

interface APIZaxiang {
    companion object {
        fun service() =
            HttpManager.create(app.applicationContext, "http://beauty.hebzd.com/api/zaxiang/") {
                addConverterFactory(GsonConverterFactory.create())
                addInterceptor("mine", BaseTokenInterceptor())
            }.getAPI(APIZaxiang::class.java)
    }

    /**
     *
     */
    @POST("hospital")
    suspend fun hospital(): NetResponse<List<HospitalEntity>>

    /**
     *
     */
    @JvmSuppressWildcards
    @POST("doctor/serve/add")
    @Multipart
    suspend fun doctorServeAdd(
        @Part("hospital_id") hospital_id: RequestBody,
        @Part("department_id") department_id: RequestBody,
        @Part("appointment_time") appointment_time: RequestBody,
        @Part("name") name: RequestBody,
        @Part("id_number") id_number: RequestBody,
        @Part("phone") phone: RequestBody,
        @Part("description") description: RequestBody,
        @PartMap picture: Map<String, RequestBody>
    ): @JvmSuppressWildcards NetResponse<Any>

    /**
     *
     */
    @JvmSuppressWildcards
    @POST("examination/add")
    @Multipart
    suspend fun examinationAdd(
        @Part("description") description: RequestBody,
        @PartMap picture: Map<String, RequestBody>
    ): @JvmSuppressWildcards NetResponse<Any>

    /**
     *
     */
    @POST("examination/list")
    @FormUrlEncoded
    suspend fun examinationList(
        @Field("pageNumber") pageNumber: Int,
        @Field("pageSize") pageSize: Int = DEFAULT_ROW
    ): NetResponse<List<ExaminationListEntity>>
 /**
     *
     */
    @POST("doctor/serve/info")
    @FormUrlEncoded
    suspend fun doctorServeInfo(
        @Field("doctor_serve_id") doctor_serve_id: String
    ): NetResponse<DoctorServeInfoEntity>

    /**
     *
     */
    @POST("doctor/serve/list")
    @FormUrlEncoded
    suspend fun doctorServeList(
        @Field("pageNumber") pageNumber: Int,
        @Field("pageSize") pageSize: Int = DEFAULT_ROW
    ): NetResponse<List<doctorServeListEntity>>

}